<?php

namespace Home\Dao;
use Think\Model\BaseDao;

class StudentDao extends BaseDao{

    protected $_map = array(
        'sd_boss_add'               => 'sch_id',
        'de_boss_add'               => 'dept_id',
        'noun_boss_add'             => 'pro_id',
        'class_boss_add'            => 'cla_id',
        'add_student_id'            => 'stu_id',
        'add_student_name'          => 'stu_name',
        'add_student_sex'           => 'stu_sex',
        'add_student_status'        => 'stu_status',
        'sd_boss_export'            => 'sch_id',
        'de_boss_export'            => 'dept_id',
        'noun_boss_export'          => 'pro_id',
        'class_boss_export'         => 'cla_id',
        'export_student_id'         => 'stu_id',
        'export_student_name'       => 'stu_name',
        'export_student_sex'        => 'stu_sex',
        'export_student_status'     => 'stu_status',
        'sd_boss_edit'               => 'sch_id',
        'de_boss_edit'               => 'dept_id',
        'noun_boss_edit'             => 'pro_id',
        'class_boss_edit'            => 'cla_id',
        'edit_student_id'            => 'stu_id',
        'edit_student_name'          => 'stu_name',
        'edit_student_sex'           => 'stu_sex',
        'edit_student_status'        => 'stu_status',
        'delete_student_id'          => 'stu_id',
    );
    protected $_validate = array(
        array('sch_id','0','请选择所属学院',0,'notequal'),
        array('dept_id','0','请选择所属系部',0,'notequal'),
        array('pro_id','0','请选择所属专业',0,'notequal'),
        array('cla_id','0','请选择所属班级',0,'notequal'),
        array('stu_id','require','学号不能为空'),
        array('stu_name','require','学生姓名不能为空'),
        array('stu_sex','0','请选择学生性别',0,'notequal'),
        array('stu_status','0','请选择学生状态',0,'notequal'),
    );
    protected $_auto = array(
        array('stu_sex','getStuSexByValue',3,'function'),
        array('stu_status','getStuStatusByValue',3,'function'),
    );
}

?>